<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>数值扩展</title>
</head>
<body>
  <script>
    // Number.EPSILON 是 JavaScript 表示的最小精度
    function equal(a,b){
      if(Math.abs(a-b) < Number.EPSILON){
        return true;
      }else{
        return false;
      }
    }
    console.log(0.1 + 0.2 === 0.3);
    console.log(equal(0.1 + 0.2 ,0.3));

    
  </script>
</body>
</html>